package cn.isjinhao.se.sql.grammar.statement.delete.represention;

import cn.isjinhao.se.sql.grammar.CurdStatementVisitor;
import cn.isjinhao.se.sql.grammar.statement.delete.SingleDeleteMetaInfo;
import cn.isjinhao.se.sql.grammar.CurdStatement;
import cn.isjinhao.se.sql.lexical.token.Token;

/**
 * @Author ISJINHAO
 * @Date 2021/4/8 20:38
 */
public class Delete extends CurdStatement {

    private SingleDeleteMetaInfo singleDeleteMetaInfo;

    private Token tableName;

    private CurdStatement whereSeg;

    public Delete(Token tableName, CurdStatement whereSeg) {
        this.tableName = tableName;
        this.whereSeg = whereSeg;
    }

    @Override
    public <R> R accept(CurdStatementVisitor<R> curdStatementVisitor) {
        return curdStatementVisitor.visitDelete(this);
    }

    public Token getTableName() {
        return tableName;
    }

    public CurdStatement getWhereSeg() {
        return whereSeg;
    }

    public void setSingleDeleteMetaInfo(SingleDeleteMetaInfo singleDeleteMetaInfo) {
        this.singleDeleteMetaInfo = singleDeleteMetaInfo;
    }
}
